import os from 'os';
// 获取本机ip
const getIPAdress = () => {
    const interfaces = os.networkInterfaces();
    for (var devName in interfaces) {
        var iface = interfaces[devName];
        for (var i = 0; i < iface.length; i++) {
            var alias = iface[i];
            if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal) {
                return alias.address;
            }
        }
    }
}
// console.log(getIPAdress(),os.networkInterfaces().enp3s0[1].address);
export const localAdress = getIPAdress() //局域网的ip